home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 May / Ahoy_Magazine_87-05_1987_Double_L_Side_A.d64 / Outcast Order 2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  368b  |  11 lines

  1. 0 rem << cd41-5 >>
  2. 1 rem ==================================
  3. 2 rem    commodares problem #37-2 :
  4. 3 print"[147]outcast order"
  5. 4 rem    solution by
  6. 5 rem    keith kushner
  7. 6 rem ==================================
  8. 10 input"n,m";n,m:dim aa(n):for t=1 to n: aa(t)=t : next t
  9. 20 for u=nto1step-1:p=int(((p+m)/u-int((p+m)/u))*u+.5):p=p-u*(p=0):print aa(p)
  10. 30 for v=p to u-1:aa(v)=aa(v+1):next v:p=p-1 : next u
  11.